/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 visibility_point.h

	$Header: /heroes4/visibility_point.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( VISIBILITY_POINT_H_INCLUDED )
#define VISIBILITY_POINT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <assert.h>

#include "abstract_tile.h"
#include "map_point.h"
#include "sized_int_types.h"
#include "skill.h"

// -------------------------------------------------------------------
// visibilty information for a point
// -------------------------------------------------------------------
class t_visibility_point : public t_map_point_2d
{
public:
	explicit t_visibility_point(
		t_tile_visibility	visibility = k_tile_never_explored,
		t_skill_mastery		anti_stealth = k_mastery_none );
	explicit t_visibility_point(
		t_map_point_2d const &	point,
		t_tile_visibility		visibility = k_tile_never_explored,
		t_skill_mastery			anti_stealth = k_mastery_none );

	t_skill_mastery		get_anti_stealth() const;
	t_tile_visibility	get_visibility() const;
	void				set_anti_stealth(
							t_skill_mastery	new_anti_stealth );
	void				set_visibility(
							t_tile_visibility	new_visibility );

private:
	t_int16	m_visibility;
	t_int16	m_anti_stealth;
};

inline t_visibility_point::t_visibility_point(
	t_tile_visibility	visibility,
	t_skill_mastery		anti_stealth )
	:	m_visibility( visibility ),
		m_anti_stealth( anti_stealth )
{
	assert( visibility >= 0 && visibility < k_tile_visibility_count );
	assert( anti_stealth >= k_mastery_none && anti_stealth < k_skill_mastery_count );
}

inline t_visibility_point::t_visibility_point(
	t_map_point_2d const &	point,
	t_tile_visibility		visibility,
	t_skill_mastery			anti_stealth )
	:	t_map_point_2d( point ),
		m_visibility( visibility ),
		m_anti_stealth( anti_stealth )
{
	assert( visibility >= 0 && visibility < k_tile_visibility_count );
	assert( anti_stealth >= k_mastery_none && anti_stealth < k_skill_mastery_count );
}

inline t_skill_mastery t_visibility_point::get_anti_stealth() const
{
	return t_skill_mastery( m_anti_stealth );
}

inline t_tile_visibility t_visibility_point::get_visibility() const
{
	return t_tile_visibility( m_visibility );
}

inline void t_visibility_point::set_anti_stealth(
	t_skill_mastery	new_anti_stealth )
{
	assert( new_anti_stealth >= k_mastery_none && new_anti_stealth < k_skill_mastery_count );
	m_anti_stealth = new_anti_stealth;
}

inline void t_visibility_point::set_visibility(
	t_tile_visibility	new_visibility )
{
	assert( new_visibility >= 0 && new_visibility < k_tile_visibility_count );
	m_visibility = new_visibility;
}

#endif // VISIBILITY_POINT_H_INCLUDED
